package com.gill.exp.common.exception.base;

/**
 * @program: mikasa
 * @description:
 * @author: Gill
 * @create: 2021-04-01 12:10
 **/
public class BaseException extends RuntimeException{

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private String code;

    /**
     * 错误消息
     */
    private String msg;

    /**
     * 错误码对应的参数
     */
    private Object[] args;

    public BaseException(String code,String msg,Object[] args){
        this.code = code;
        this.msg = msg;
        this.args = args;
    }

    public BaseException(String code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    @Override
    public String getMessage() {
        return getMsg();
    }
}
